[DIRMINA-1146] Pass message to next filter in SslFilter - #61
Conversation
|
Hi, thanks for the proposed patch. I'm not sure it's related, but I don't have this failure when I don't apply your proposed patch. I have tested with Java 17 and 25. If I run the exact same class test in eclipse, it passes green... Go fish... I'm trying to see what could be the cause of this issue (beside the fact the connection has been closed) |
|
Hello, I was getting slightly different error for Windows 11 / temurin / Java 17 I also consistently get an error on 2.2.x
Let me have a look as well. |
|
I also have the same issue with the NPE when the message is sent back to the IoHandler. Now to understand why the socket has been closed... |
|
ok, I think the issue is on the client side. On the server, the connection get closed by the client thus it can't return anything to the client. I still have no idea why the client closes the connection, I keep digging. |
|
Test needs modification, but for SSL sometimes I get 3 messages in total, sometimes 4. |
|
Looks better now with additional timeout. We send SSL handshake messages now - so total 4 messages in SSL.
|
994374a to
e1f4ba9
Compare
|
Ok, I was totally wrong. The server do close the connection, and more specifically the The key here is that the Here are the logs: and then later on: I have changd the and we can clearly see that we are dealing with TLS messages: 16 is for a HS TLS message, 17 is the wrapped message, crypted. |
|
Yes that is correct. We had SSL related messages via
I was wondering if this is going to be a requirement. Initial SSL Hello messages are easy to detect and drop by looking at the TLS header, but SSL FINISHED / CLOSED is not. |
e1f4ba9 to
e20bb25
Compare
|
Actually, in the Two options here:
I clearly don't like the first option because that would mean deep in the |
e20bb25 to
50a54f6
Compare
|
Ok. I misunderstood the root cause of the problem. My original assumption was that the application level messages were the problem, but it seems that SSL messages are.
I have a feeling I pushed and squashed the latest changes. Let me know how you see it. |
|
Mina is a complicated beast ;-) I'll have a look at your last commit. Thanks! |
|
Looks good to me (after a late battle with MDC, which does not really liked the added logs I put in AbstractPollingIoProcessor, something I have to fix later). Many thanks for your patch, it has been applied! |
|
Thanks for looking and help investigating as well. Any plans for the next 2.2.x release? Probably not soon. |
|
@the-thing could you send me your email on elecharny@apache.org, please? Many thanks! |
Fixes DIRMINA-1146
It will also help fix quickfix-j/quickfixj#406
Changes
Currently none of the
EncryptedWriteRequestinstances have parent message provided which means that original message and request is always the same instance. We must pass all the messages down the chain.org.apache.mina.filter.ssl.SslFilternow also passes the encrypted message down the filter chain, eventually reachingorg.apache.mina.core.filterchain.DefaultIoFilterChain.TailFilterwhich will increase the written message count and also decrement scheduled message count.Obviously this change will have an impact filters configured between
org.apache.mina.filter.ssl.SslFilterandorg.apache.mina.core.filterchain.DefaultIoFilterChain.TailFilter, but I think users should make changes accordingly in this case.